import java.applet.Applet; import java.awt.*; import java.awt.event.*; class MyFrame extends Frame implements ActionListener { CardLayout lm; public MyFrame() { lm=new CardLayout(); setLayout(lm); String arr[]={"Monday","Tuesday","Wednesday", "Thrusday","Friday", "Saturday","Sunday"}; Color clr[]={Color.red,Color.orange,Color.yellow, Color.green,Color.cyan, Color.blue,Color.magenta}; Font fnt; fnt =new Font("TimesRoman",Font.BOLD,100); for(int i=0;i<7;i++) { Button btn=new Button(arr[i]); add(btn); btn.addActionListener( this ); btn.setBackground(clr[i]); btn.setFont(fnt); } } public void actionPerformed(ActionEvent e) { lm.next(this); } } class demo { public static void main(String argvs[]) { MyFrame frm=new MyFrame(); frm.setSize(400,300); frm.setVisible(true); } }